//
//  MQEmoticon.swift
//  SinaWeiBo
//
//  Created by 毛强 on 16/2/3.
//  Copyright © 2016年 itheima. All rights reserved.
//

import UIKit

class MQEmoticon: NSObject,NSCoding {
    var chs:String?
    var png:String?
    var type:String?
    var code:String?
    var path:String?
    
    var allPath:String{
        return "\(path!)/\(png!)"
    }
    
    init(dict:[String:AnyObject]){
        super.init()
        setValuesForKeysWithDictionary(dict)
    }
    
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {}
    
    /**
     解档
     
     :param: aDecoder <#aDecoder description#>
     
     :returns: <#return value description#>
     */
    required init?(coder aDecoder: NSCoder) {
        chs = aDecoder.decodeObjectForKey("chs") as? String
        png = aDecoder.decodeObjectForKey("png") as? String
        type = aDecoder.decodeObjectForKey("type") as? String
        code = aDecoder.decodeObjectForKey("code") as? String
        path = aDecoder.decodeObjectForKey("path") as? String
    }
    
    /**
     归档
     
     :param: aCoder <#aCoder description#>
     */
    func encodeWithCoder(aCoder: NSCoder) {
        aCoder.encodeObject(chs,forKey: "chs")
        aCoder.encodeObject(png, forKey: "png")
        aCoder.encodeObject(type, forKey: "type")
        aCoder.encodeObject(code, forKey: "code")
        aCoder.encodeObject(path, forKey: "path")
    }


}
